//package com.smartstate.admin.biz.entity.dto;
//
//import com.smartstate.admin.biz.entity.bo.EnterpriseIdPermission;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//
//import javax.validation.constraints.NotBlank;
//import javax.validation.constraints.NotEmpty;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//import java.util.stream.Collectors;
//
//@ApiModel(value = "enterprisePermission", description = "企业--权限")
//@Data
//public class EnterprisePermissionDto {
//
//    @NotBlank
//    @ApiModelProperty("企业id")
//    private String EnterpriseId;
//
//    @NotEmpty
//    @ApiModelProperty("权限信息")
//    private List<PermissionInfo> permissionInfos;
//
//
//    /**
//     * 形成权限id 和企业id一对一数据结构
//     * @param excludePermissionIds
//     * @return
//     */
//    public List<EnterpriseIdPermission> initSysDeptPermission(List<EnterpriseIdPermission> excludePermissionIds) {
//        List<EnterpriseIdPermission> enterpriseIdPermissions = new ArrayList<>();
//        Map<String, List<EnterpriseIdPermission>> collect = excludePermissionIds.stream().collect(Collectors.groupingBy(EnterpriseIdPermission::getSysPermissionId));
//        for (PermissionInfo permissionInfo : permissionInfos) {
//            if (collect.containsKey(permissionInfo.getPermissionId())) {
//                //TODO 待添加逻辑
//            } else {
//                EnterpriseIdPermission enterpriseIdPermission = new EnterpriseIdPermission(EnterpriseId, permissionInfo.getPermissionId(),permissionInfo.getPermissionType());
//                enterpriseIdPermissions.add(enterpriseIdPermission);
//            }
//        }
//        return enterpriseIdPermissions;
//    }
//
//    /**
//     * 形成权限id 和企业id一对一数据结构
//     * @return
//     */
//    public List<EnterpriseIdPermission> initSysDeptPermission() {
//        List<EnterpriseIdPermission> enterpriseIdPermissions = new ArrayList<>();
//        for (PermissionInfo permissionInfo : permissionInfos) {
//            EnterpriseIdPermission enterpriseIdPermission = new EnterpriseIdPermission(EnterpriseId, permissionInfo.getPermissionId(),permissionInfo.getPermissionType());
//            enterpriseIdPermissions.add(enterpriseIdPermission);
//        }
//        return enterpriseIdPermissions;
//    }
//
//    @Data
//    @ApiModel(value = "PermissionInfo", description = "权限详情")
//    public static class  PermissionInfo{
//        @ApiModelProperty("权限ID")
//        private String  permissionId;
//        @ApiModelProperty("权限类型：1读权限 2：写权限 3：读写权限(默认)")
//        private Integer permissionType;
//    }
//}
